package darklaunch

import (
	"gopkg.in/yaml.v2"
)

type Parser interface {
	Parse(content string) (*DarkConfig, error)
}

type YamlParser struct{}

func (y *YamlParser) Parse(content string) (*DarkConfig, error) {
	var config DarkConfig
	err := yaml.Unmarshal([]byte(content), &config)
	if err != nil {
		return nil, err
	}
	return &config, nil
}
